﻿package media 
{
	
	/**
	 * ...
	 * @author keys_star@163.com
	 */
	public class fixSound 
	{
		
		public function fixSound() 
		{
			
		}
		public static function getSoundItem(n:Number) {
			var a = n.toString().split('');
			return a;
		}
		public static function getIDCardSound(n:Number,u:String) {
			var a = fixSound.getSoundItem(n);
			for (var i = 0; i < a.length; i++ ) {
				a[i] = u+'/n' + a[i];
			}
			return a;
		}
		public static function getNumSound(s:Number,u:String) {
			var a:Array = fixSound.getSoundItem(s);
			var t:Array = new Array;
			var lockStart = false;
			var len:uint = a.length;
			for (var i = 0; i < len; i++ ) {
				var n:String = a.length - i - 2 + '';
				if (lockStart) {
					if (a[i] != 0) {
						lockStart = false;
						t.push(u+"/n0");
						t.push(u+"/n"+a[i]);
						if(i<len-1){
							t.push(u+"/t" + n);
						}else {
							t.push(u+"/6");
						}
					}else{
						if(i>=len-1){
							t.push(u+"/6");
						}
					}
				}else {
					if (a[i] != 0) {
						t.push(u+"/n"+a[i]);
						if(i<len-1){
							t.push(u+"/t" + n);
						}else {
							t.push(u+"/6");
						}
					}else {
						lockStart = true;
						if(i>=len-1){
							t.push(u+"/6");
						}
					}
				}
			}
			return t;
		}
	}
}